/**
 * @author Simon Richardson - simon@ustwo.co.uk
 */
package org.osflash.signals;

import org.osflash.signals.events.GenericEvent;

class SlotTest extends ISlotTestBase {

	@:meta(Before())
	public function setUp() : Void {
		signal = new Signal();
	}

	@:meta(Test())
	public function add_listener_pause_then_resume_on_slot_should_dispatch() : Void {
		var slot : ISlot = signal.add(async.add(checkGenericEvent, 10));
		slot.enabled = false;
		slot.enabled = true;
		signal.dispatch(new GenericEvent());
	}

	@:meta(Test())
	public function addOnce_listener_pause_then_resume_on_slot_should_dispatch() : Void {
		var slot : ISlot = signal.addOnce(async.add(checkGenericEvent, 10));
		slot.enabled = false;
		slot.enabled = true;
		signal.dispatch(new GenericEvent());
	}

}

